<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - src/node_data.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - node_data.cpp<span style="font-size: 80%;"> (source / <a href="node_data.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">62</td>
            <td class="headerCovTableEntry">166</td>
            <td class="headerCovTableEntryLo">37.3 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">17</td>
            <td class="headerCovTableEntry">27</td>
            <td class="headerCovTableEntryLo">63.0 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &lt;assert.h&gt;</a>
<span class="lineNum">       2 </span>            : #include &lt;iterator&gt;
<span class="lineNum">       3 </span>            : #include &lt;sstream&gt;
<span class="lineNum">       4 </span>            : 
<span class="lineNum">       5 </span>            : #include &quot;yaml-cpp/exceptions.h&quot;
<span class="lineNum">       6 </span>            : #include &quot;yaml-cpp/node/detail/memory.h&quot;
<span class="lineNum">       7 </span>            : #include &quot;yaml-cpp/node/detail/node.h&quot;  // IWYU pragma: keep
<span class="lineNum">       8 </span>            : #include &quot;yaml-cpp/node/detail/node_data.h&quot;
<span class="lineNum">       9 </span>            : #include &quot;yaml-cpp/node/detail/node_iterator.h&quot;
<span class="lineNum">      10 </span>            : #include &quot;yaml-cpp/node/ptr.h&quot;
<span class="lineNum">      11 </span>            : #include &quot;yaml-cpp/node/type.h&quot;
<span class="lineNum">      12 </span>            : 
<span class="lineNum">      13 </span>            : namespace YAML {
<span class="lineNum">      14 </span>            : namespace detail {
<span class="lineNum">      15 </span>            : 
<a name="16"><span class="lineNum">      16 </span><span class="lineCov">       2036 : std::string node_data::empty_scalar;</span></a>
<span class="lineNum">      17 </span>            : 
<span class="lineNum">      18 </span><span class="lineCov">     136195 : node_data::node_data()</span>
<span class="lineNum">      19 </span>            :     : m_isDefined(false),
<span class="lineNum">      20 </span>            :       m_mark(Mark::null_mark()),
<span class="lineNum">      21 </span>            :       m_type(NodeType::Null),
<span class="lineNum">      22 </span>            :       m_style(EmitterStyle::Default),
<a name="23"><span class="lineNum">      23 </span><span class="lineCov">     136195 :       m_seqSize(0) {}</span></a>
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span><span class="lineCov">     136195 : void node_data::mark_defined() {</span>
<span class="lineNum">      26 </span><span class="lineCov">     136195 :   if (m_type == NodeType::Undefined)</span>
<span class="lineNum">      27 </span><span class="lineNoCov">          0 :     m_type = NodeType::Null;</span>
<span class="lineNum">      28 </span><span class="lineCov">     136195 :   m_isDefined = true;</span>
<a name="29"><span class="lineNum">      29 </span><span class="lineCov">     136195 : }</span></a>
<span class="lineNum">      30 </span>            : 
<a name="31"><span class="lineNum">      31 </span><span class="lineCov">     136195 : void node_data::set_mark(const Mark&amp; mark) { m_mark = mark; }</span></a>
<span class="lineNum">      32 </span>            : 
<span class="lineNum">      33 </span><span class="lineCov">      63996 : void node_data::set_type(NodeType::value type) {</span>
<span class="lineNum">      34 </span><span class="lineCov">      63996 :   if (type == NodeType::Undefined) {</span>
<span class="lineNum">      35 </span><span class="lineNoCov">          0 :     m_type = type;</span>
<span class="lineNum">      36 </span><span class="lineNoCov">          0 :     m_isDefined = false;</span>
<span class="lineNum">      37 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">      38 </span>            :   }
<span class="lineNum">      39 </span>            : 
<span class="lineNum">      40 </span><span class="lineCov">      63996 :   m_isDefined = true;</span>
<span class="lineNum">      41 </span><span class="lineCov">      63996 :   if (type == m_type)</span>
<span class="lineNum">      42 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">      43 </span>            : 
<span class="lineNum">      44 </span><span class="lineCov">      63996 :   m_type = type;</span>
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span><span class="lineCov">      63996 :   switch (m_type) {</span>
<span class="lineNum">      47 </span>            :     case NodeType::Null:
<span class="lineNum">      48 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      49 </span>            :     case NodeType::Scalar:
<span class="lineNum">      50 </span><span class="lineNoCov">          0 :       m_scalar.clear();</span>
<span class="lineNum">      51 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      52 </span>            :     case NodeType::Sequence:
<span class="lineNum">      53 </span><span class="lineCov">      25707 :       reset_sequence();</span>
<span class="lineNum">      54 </span><span class="lineCov">      25707 :       break;</span>
<span class="lineNum">      55 </span>            :     case NodeType::Map:
<span class="lineNum">      56 </span><span class="lineCov">      38289 :       reset_map();</span>
<span class="lineNum">      57 </span><span class="lineCov">      38289 :       break;</span>
<span class="lineNum">      58 </span>            :     case NodeType::Undefined:
<span class="lineNum">      59 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">      60 </span>            :       break;
<span class="lineNum">      61 </span>            :   }
<a name="62"><span class="lineNum">      62 </span>            : }</a>
<span class="lineNum">      63 </span>            : 
<a name="64"><span class="lineNum">      64 </span><span class="lineCov">      86374 : void node_data::set_tag(const std::string&amp; tag) { m_tag = tag; }</span></a>
<span class="lineNum">      65 </span>            : 
<a name="66"><span class="lineNum">      66 </span><span class="lineCov">      63996 : void node_data::set_style(EmitterStyle::value style) { m_style = style; }</span></a>
<span class="lineNum">      67 </span>            : 
<span class="lineNum">      68 </span><span class="lineCov">      49821 : void node_data::set_null() {</span>
<span class="lineNum">      69 </span><span class="lineCov">      49821 :   m_isDefined = true;</span>
<span class="lineNum">      70 </span><span class="lineCov">      49821 :   m_type = NodeType::Null;</span>
<a name="71"><span class="lineNum">      71 </span><span class="lineCov">      49821 : }</span></a>
<span class="lineNum">      72 </span>            : 
<span class="lineNum">      73 </span><span class="lineCov">      22378 : void node_data::set_scalar(const std::string&amp; scalar) {</span>
<span class="lineNum">      74 </span><span class="lineCov">      22378 :   m_isDefined = true;</span>
<span class="lineNum">      75 </span><span class="lineCov">      22378 :   m_type = NodeType::Scalar;</span>
<span class="lineNum">      76 </span><span class="lineCov">      22378 :   m_scalar = scalar;</span>
<span class="lineNum">      77 </span><span class="lineCov">      22378 : }</span>
<a name="78"><span class="lineNum">      78 </span>            : </a>
<span class="lineNum">      79 </span>            : // size/iterator
<span class="lineNum">      80 </span><span class="lineNoCov">          0 : std::size_t node_data::size() const {</span>
<span class="lineNum">      81 </span><span class="lineNoCov">          0 :   if (!m_isDefined)</span>
<span class="lineNum">      82 </span><span class="lineNoCov">          0 :     return 0;</span>
<span class="lineNum">      83 </span>            : 
<span class="lineNum">      84 </span><span class="lineNoCov">          0 :   switch (m_type) {</span>
<span class="lineNum">      85 </span>            :     case NodeType::Sequence:
<span class="lineNum">      86 </span><span class="lineNoCov">          0 :       compute_seq_size();</span>
<span class="lineNum">      87 </span><span class="lineNoCov">          0 :       return m_seqSize;</span>
<span class="lineNum">      88 </span>            :     case NodeType::Map:
<span class="lineNum">      89 </span><span class="lineNoCov">          0 :       compute_map_size();</span>
<span class="lineNum">      90 </span><span class="lineNoCov">          0 :       return m_map.size() - m_undefinedPairs.size();</span>
<span class="lineNum">      91 </span>            :     default:
<span class="lineNum">      92 </span><span class="lineNoCov">          0 :       return 0;</span>
<span class="lineNum">      93 </span>            :   }
<span class="lineNum">      94 </span>            :   return 0;
<a name="95"><span class="lineNum">      95 </span>            : }</a>
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span><span class="lineNoCov">          0 : void node_data::compute_seq_size() const {</span>
<span class="lineNum">      98 </span><span class="lineNoCov">          0 :   while (m_seqSize &lt; m_sequence.size() &amp;&amp; m_sequence[m_seqSize]-&gt;is_defined())</span>
<span class="lineNum">      99 </span><span class="lineNoCov">          0 :     m_seqSize++;</span>
<a name="100"><span class="lineNum">     100 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     101 </span>            : 
<span class="lineNum">     102 </span><span class="lineNoCov">          0 : void node_data::compute_map_size() const {</span>
<span class="lineNum">     103 </span><span class="lineNoCov">          0 :   kv_pairs::iterator it = m_undefinedPairs.begin();</span>
<span class="lineNum">     104 </span><span class="lineNoCov">          0 :   while (it != m_undefinedPairs.end()) {</span>
<span class="lineNum">     105 </span><span class="lineNoCov">          0 :     kv_pairs::iterator jt = std::next(it);</span>
<span class="lineNum">     106 </span><span class="lineNoCov">          0 :     if (it-&gt;first-&gt;is_defined() &amp;&amp; it-&gt;second-&gt;is_defined())</span>
<span class="lineNum">     107 </span><span class="lineNoCov">          0 :       m_undefinedPairs.erase(it);</span>
<span class="lineNum">     108 </span><span class="lineNoCov">          0 :     it = jt;</span>
<span class="lineNum">     109 </span>            :   }
<a name="110"><span class="lineNum">     110 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     111 </span>            : 
<span class="lineNum">     112 </span><span class="lineCov">      35042 : const_node_iterator node_data::begin() const {</span>
<span class="lineNum">     113 </span><span class="lineCov">      35042 :   if (!m_isDefined)</span>
<span class="lineNum">     114 </span><span class="lineNoCov">          0 :     return const_node_iterator();</span>
<span class="lineNum">     115 </span>            : 
<span class="lineNum">     116 </span><span class="lineCov">      35042 :   switch (m_type) {</span>
<span class="lineNum">     117 </span>            :     case NodeType::Sequence:
<span class="lineNum">     118 </span><span class="lineCov">      12678 :       return const_node_iterator(m_sequence.begin());</span>
<span class="lineNum">     119 </span>            :     case NodeType::Map:
<span class="lineNum">     120 </span><span class="lineCov">      22364 :       return const_node_iterator(m_map.begin(), m_map.end());</span>
<span class="lineNum">     121 </span>            :     default:
<span class="lineNum">     122 </span><span class="lineNoCov">          0 :       return const_node_iterator();</span>
<span class="lineNum">     123 </span>            :   }
<a name="124"><span class="lineNum">     124 </span>            : }</a>
<span class="lineNum">     125 </span>            : 
<span class="lineNum">     126 </span><span class="lineNoCov">          0 : node_iterator node_data::begin() {</span>
<span class="lineNum">     127 </span><span class="lineNoCov">          0 :   if (!m_isDefined)</span>
<span class="lineNum">     128 </span><span class="lineNoCov">          0 :     return node_iterator();</span>
<span class="lineNum">     129 </span>            : 
<span class="lineNum">     130 </span><span class="lineNoCov">          0 :   switch (m_type) {</span>
<span class="lineNum">     131 </span>            :     case NodeType::Sequence:
<span class="lineNum">     132 </span><span class="lineNoCov">          0 :       return node_iterator(m_sequence.begin());</span>
<span class="lineNum">     133 </span>            :     case NodeType::Map:
<span class="lineNum">     134 </span><span class="lineNoCov">          0 :       return node_iterator(m_map.begin(), m_map.end());</span>
<span class="lineNum">     135 </span>            :     default:
<span class="lineNum">     136 </span><span class="lineNoCov">          0 :       return node_iterator();</span>
<span class="lineNum">     137 </span>            :   }
<a name="138"><span class="lineNum">     138 </span>            : }</a>
<span class="lineNum">     139 </span>            : 
<span class="lineNum">     140 </span><span class="lineCov">     106252 : const_node_iterator node_data::end() const {</span>
<span class="lineNum">     141 </span><span class="lineCov">     106252 :   if (!m_isDefined)</span>
<span class="lineNum">     142 </span><span class="lineNoCov">          0 :     return const_node_iterator();</span>
<span class="lineNum">     143 </span>            : 
<span class="lineNum">     144 </span><span class="lineCov">     106252 :   switch (m_type) {</span>
<span class="lineNum">     145 </span>            :     case NodeType::Sequence:
<span class="lineNum">     146 </span><span class="lineCov">      47376 :       return const_node_iterator(m_sequence.end());</span>
<span class="lineNum">     147 </span>            :     case NodeType::Map:
<span class="lineNum">     148 </span><span class="lineCov">      58876 :       return const_node_iterator(m_map.end(), m_map.end());</span>
<span class="lineNum">     149 </span>            :     default:
<span class="lineNum">     150 </span><span class="lineNoCov">          0 :       return const_node_iterator();</span>
<span class="lineNum">     151 </span>            :   }
<a name="152"><span class="lineNum">     152 </span>            : }</a>
<span class="lineNum">     153 </span>            : 
<span class="lineNum">     154 </span><span class="lineNoCov">          0 : node_iterator node_data::end() {</span>
<span class="lineNum">     155 </span><span class="lineNoCov">          0 :   if (!m_isDefined)</span>
<span class="lineNum">     156 </span><span class="lineNoCov">          0 :     return node_iterator();</span>
<span class="lineNum">     157 </span>            : 
<span class="lineNum">     158 </span><span class="lineNoCov">          0 :   switch (m_type) {</span>
<span class="lineNum">     159 </span>            :     case NodeType::Sequence:
<span class="lineNum">     160 </span><span class="lineNoCov">          0 :       return node_iterator(m_sequence.end());</span>
<span class="lineNum">     161 </span>            :     case NodeType::Map:
<span class="lineNum">     162 </span><span class="lineNoCov">          0 :       return node_iterator(m_map.end(), m_map.end());</span>
<span class="lineNum">     163 </span>            :     default:
<span class="lineNum">     164 </span><span class="lineNoCov">          0 :       return node_iterator();</span>
<span class="lineNum">     165 </span>            :   }
<span class="lineNum">     166 </span>            : }
<a name="167"><span class="lineNum">     167 </span>            : </a>
<span class="lineNum">     168 </span>            : // sequence
<span class="lineNum">     169 </span><span class="lineCov">      24906 : void node_data::push_back(node&amp; node, shared_memory_holder /* pMemory */) {</span>
<span class="lineNum">     170 </span><span class="lineCov">      24906 :   if (m_type == NodeType::Undefined || m_type == NodeType::Null) {</span>
<span class="lineNum">     171 </span><span class="lineNoCov">          0 :     m_type = NodeType::Sequence;</span>
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :     reset_sequence();</span>
<span class="lineNum">     173 </span>            :   }
<span class="lineNum">     174 </span>            : 
<span class="lineNum">     175 </span><span class="lineCov">      24906 :   if (m_type != NodeType::Sequence)</span>
<span class="lineNum">     176 </span><span class="lineNoCov">          0 :     throw BadPushback();</span>
<span class="lineNum">     177 </span>            : 
<span class="lineNum">     178 </span><span class="lineCov">      24906 :   m_sequence.push_back(&amp;node);</span>
<a name="179"><span class="lineNum">     179 </span><span class="lineCov">      24906 : }</span></a>
<span class="lineNum">     180 </span>            : 
<span class="lineNum">     181 </span><span class="lineCov">      33796 : void node_data::insert(node&amp; key, node&amp; value, shared_memory_holder pMemory) {</span>
<span class="lineNum">     182 </span><span class="lineCov">      33796 :   switch (m_type) {</span>
<span class="lineNum">     183 </span>            :     case NodeType::Map:
<span class="lineNum">     184 </span><span class="lineCov">      33796 :       break;</span>
<span class="lineNum">     185 </span>            :     case NodeType::Undefined:
<span class="lineNum">     186 </span>            :     case NodeType::Null:
<span class="lineNum">     187 </span>            :     case NodeType::Sequence:
<span class="lineNum">     188 </span><span class="lineNoCov">          0 :       convert_to_map(pMemory);</span>
<span class="lineNum">     189 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     190 </span>            :     case NodeType::Scalar:
<span class="lineNum">     191 </span><span class="lineNoCov">          0 :       throw BadSubscript();</span>
<span class="lineNum">     192 </span>            :   }
<span class="lineNum">     193 </span>            : 
<span class="lineNum">     194 </span><span class="lineCov">      33796 :   insert_map_pair(key, value);</span>
<span class="lineNum">     195 </span><span class="lineCov">      33796 : }</span>
<a name="196"><span class="lineNum">     196 </span>            : </a>
<span class="lineNum">     197 </span>            : // indexing
<span class="lineNum">     198 </span><span class="lineNoCov">          0 : node* node_data::get(node&amp; key, shared_memory_holder /* pMemory */) const {</span>
<span class="lineNum">     199 </span><span class="lineNoCov">          0 :   if (m_type != NodeType::Map) {</span>
<span class="lineNum">     200 </span><span class="lineNoCov">          0 :     return NULL;</span>
<span class="lineNum">     201 </span>            :   }
<span class="lineNum">     202 </span>            : 
<span class="lineNum">     203 </span><span class="lineNoCov">          0 :   for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {</span>
<span class="lineNum">     204 </span><span class="lineNoCov">          0 :     if (it-&gt;first-&gt;is(key))</span>
<span class="lineNum">     205 </span><span class="lineNoCov">          0 :       return it-&gt;second;</span>
<span class="lineNum">     206 </span>            :   }
<span class="lineNum">     207 </span>            : 
<span class="lineNum">     208 </span><span class="lineNoCov">          0 :   return NULL;</span>
<a name="209"><span class="lineNum">     209 </span>            : }</a>
<span class="lineNum">     210 </span>            : 
<span class="lineNum">     211 </span><span class="lineNoCov">          0 : node&amp; node_data::get(node&amp; key, shared_memory_holder pMemory) {</span>
<span class="lineNum">     212 </span><span class="lineNoCov">          0 :   switch (m_type) {</span>
<span class="lineNum">     213 </span>            :     case NodeType::Map:
<span class="lineNum">     214 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     215 </span>            :     case NodeType::Undefined:
<span class="lineNum">     216 </span>            :     case NodeType::Null:
<span class="lineNum">     217 </span>            :     case NodeType::Sequence:
<span class="lineNum">     218 </span><span class="lineNoCov">          0 :       convert_to_map(pMemory);</span>
<span class="lineNum">     219 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     220 </span>            :     case NodeType::Scalar:
<span class="lineNum">     221 </span><span class="lineNoCov">          0 :       throw BadSubscript();</span>
<span class="lineNum">     222 </span>            :   }
<span class="lineNum">     223 </span>            : 
<span class="lineNum">     224 </span><span class="lineNoCov">          0 :   for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {</span>
<span class="lineNum">     225 </span><span class="lineNoCov">          0 :     if (it-&gt;first-&gt;is(key))</span>
<span class="lineNum">     226 </span><span class="lineNoCov">          0 :       return *it-&gt;second;</span>
<span class="lineNum">     227 </span>            :   }
<span class="lineNum">     228 </span>            : 
<span class="lineNum">     229 </span><span class="lineNoCov">          0 :   node&amp; value = pMemory-&gt;create_node();</span>
<span class="lineNum">     230 </span><span class="lineNoCov">          0 :   insert_map_pair(key, value);</span>
<span class="lineNum">     231 </span><span class="lineNoCov">          0 :   return value;</span>
<a name="232"><span class="lineNum">     232 </span>            : }</a>
<span class="lineNum">     233 </span>            : 
<span class="lineNum">     234 </span><span class="lineNoCov">          0 : bool node_data::remove(node&amp; key, shared_memory_holder /* pMemory */) {</span>
<span class="lineNum">     235 </span><span class="lineNoCov">          0 :   if (m_type != NodeType::Map)</span>
<span class="lineNum">     236 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     237 </span>            : 
<span class="lineNum">     238 </span><span class="lineNoCov">          0 :   for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) {</span>
<span class="lineNum">     239 </span><span class="lineNoCov">          0 :     if (it-&gt;first-&gt;is(key)) {</span>
<span class="lineNum">     240 </span><span class="lineNoCov">          0 :       m_map.erase(it);</span>
<span class="lineNum">     241 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     242 </span>            :     }
<span class="lineNum">     243 </span>            :   }
<span class="lineNum">     244 </span>            : 
<span class="lineNum">     245 </span><span class="lineNoCov">          0 :   return false;</span>
<a name="246"><span class="lineNum">     246 </span>            : }</a>
<span class="lineNum">     247 </span>            : 
<span class="lineNum">     248 </span><span class="lineCov">      25707 : void node_data::reset_sequence() {</span>
<span class="lineNum">     249 </span><span class="lineCov">      25707 :   m_sequence.clear();</span>
<span class="lineNum">     250 </span><span class="lineCov">      25707 :   m_seqSize = 0;</span>
<a name="251"><span class="lineNum">     251 </span><span class="lineCov">      25707 : }</span></a>
<span class="lineNum">     252 </span>            : 
<span class="lineNum">     253 </span><span class="lineCov">      38289 : void node_data::reset_map() {</span>
<span class="lineNum">     254 </span><span class="lineCov">      38289 :   m_map.clear();</span>
<span class="lineNum">     255 </span><span class="lineCov">      38289 :   m_undefinedPairs.clear();</span>
<a name="256"><span class="lineNum">     256 </span><span class="lineCov">      38289 : }</span></a>
<span class="lineNum">     257 </span>            : 
<span class="lineNum">     258 </span><span class="lineCov">      33796 : void node_data::insert_map_pair(node&amp; key, node&amp; value) {</span>
<span class="lineNum">     259 </span><span class="lineCov">      33796 :   m_map[&amp;key] = &amp;value;</span>
<span class="lineNum">     260 </span><span class="lineCov">      33796 :   if (!key.is_defined() || !value.is_defined())</span>
<span class="lineNum">     261 </span><span class="lineNoCov">          0 :     m_undefinedPairs.push_back(kv_pair(&amp;key, &amp;value));</span>
<a name="262"><span class="lineNum">     262 </span><span class="lineCov">      33796 : }</span></a>
<span class="lineNum">     263 </span>            : 
<span class="lineNum">     264 </span><span class="lineNoCov">          0 : void node_data::convert_to_map(shared_memory_holder pMemory) {</span>
<span class="lineNum">     265 </span><span class="lineNoCov">          0 :   switch (m_type) {</span>
<span class="lineNum">     266 </span>            :     case NodeType::Undefined:
<span class="lineNum">     267 </span>            :     case NodeType::Null:
<span class="lineNum">     268 </span><span class="lineNoCov">          0 :       reset_map();</span>
<span class="lineNum">     269 </span><span class="lineNoCov">          0 :       m_type = NodeType::Map;</span>
<span class="lineNum">     270 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     271 </span>            :     case NodeType::Sequence:
<span class="lineNum">     272 </span><span class="lineNoCov">          0 :       convert_sequence_to_map(pMemory);</span>
<span class="lineNum">     273 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     274 </span>            :     case NodeType::Map:
<span class="lineNum">     275 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">     276 </span>            :     case NodeType::Scalar:
<span class="lineNum">     277 </span><span class="lineNoCov">          0 :       assert(false);</span>
<span class="lineNum">     278 </span>            :       break;
<span class="lineNum">     279 </span>            :   }
<a name="280"><span class="lineNum">     280 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     281 </span>            : 
<span class="lineNum">     282 </span><span class="lineNoCov">          0 : void node_data::convert_sequence_to_map(shared_memory_holder pMemory) {</span>
<span class="lineNum">     283 </span><span class="lineNoCov">          0 :   assert(m_type == NodeType::Sequence);</span>
<span class="lineNum">     284 </span>            : 
<span class="lineNum">     285 </span><span class="lineNoCov">          0 :   reset_map();</span>
<span class="lineNum">     286 </span><span class="lineNoCov">          0 :   for (std::size_t i = 0; i &lt; m_sequence.size(); i++) {</span>
<span class="lineNum">     287 </span><span class="lineNoCov">          0 :     std::stringstream stream;</span>
<span class="lineNum">     288 </span><span class="lineNoCov">          0 :     stream &lt;&lt; i;</span>
<span class="lineNum">     289 </span>            : 
<span class="lineNum">     290 </span><span class="lineNoCov">          0 :     node&amp; key = pMemory-&gt;create_node();</span>
<span class="lineNum">     291 </span><span class="lineNoCov">          0 :     key.set_scalar(stream.str());</span>
<span class="lineNum">     292 </span><span class="lineNoCov">          0 :     insert_map_pair(key, *m_sequence[i]);</span>
<span class="lineNum">     293 </span>            :   }
<span class="lineNum">     294 </span>            : 
<span class="lineNum">     295 </span><span class="lineNoCov">          0 :   reset_sequence();</span>
<span class="lineNum">     296 </span><span class="lineNoCov">          0 :   m_type = NodeType::Map;</span>
<a name="297"><span class="lineNum">     297 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     298 </span>            : }
<span class="lineNum">     299 </span><span class="lineCov">       6108 : }</span>
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
